package com.mars.module.admin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.mars.module.system.entity.BaseEntity;

import java.time.LocalDateTime;

/**
 * 新闻对象 news
 *
 * @author mars
 * @date 2024-03-04
 */

@Data
@ApiModel(value = "新闻对象")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("news")
public class News {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 标题
     */
    @Excel(name = "标题")
    @ApiModelProperty(value = "标题")
    private String title;
    /**
     * 内容
     */
    @Excel(name = "内容")
    @ApiModelProperty(value = "内容")
    private String content;
    /**
     * 作者
     */
    @Excel(name = "作者")
    @ApiModelProperty(value = "作者")
    private String author;
    /**
     * 浏览数量
     */
    @Excel(name = "浏览数量")
    @ApiModelProperty(value = "浏览数量")
    private Integer views;
    /**
     * 点赞数量
     */
    @Excel(name = "点赞数量")
    @ApiModelProperty(value = "点赞数量")
    private Integer likes;
    /**
     * 收藏数量
     */
    @Excel(name = "收藏数量")
    @ApiModelProperty(value = "收藏数量")
    private Integer collect;
    /**
     * 分类ID
     */
    @Excel(name = "分类ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "分类ID")
    private String categoryId;

    @TableField(exist = false)
    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @Excel(name = "新闻状态")
    @ApiModelProperty(value = "新闻状态")
    private String status;
    /**
     * url
     */
    @Excel(name = "url")
    @ApiModelProperty(value = "url")
    private String url;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人ID")
    private Long createById;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否关注新闻")
    private String isFollowNews;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否关注新闻分类")
    private String isFollowCategory;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否点赞")
    private String isLike;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否收藏")
    private String isCollect;
}
